use serde::Serialize;
use serde_cbor::Serializer;

pub fn encode<T: Serialize>(body: &T, buf: &mut Vec<u8>) -> Result<(), serde_cbor::Error> {
    let mut serializer = Serializer::new(buf);
    body.serialize(&mut serializer)?;

    Ok(())
}
